// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CollapsiblePanelDesigner.cs" company="">
//   
// </copyright>
// <summary>
//   The collapsible panel designer.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace OVT.CustomControls
{
    using System;
    using System.ComponentModel.Design;
    using System.Windows.Forms.Design;

    /// <summary>
    /// The collapsible panel designer.
    /// </summary>
    public class CollapsiblePanelDesigner : ParentControlDesigner
    {
        /// <summary>
        /// Gets ActionLists.
        /// </summary>
        public override DesignerActionListCollection ActionLists
        {
            get
            {
                var collection = new DesignerActionListCollection();
                if (this.Control != null && this.Control is CollapsiblePanel)
                {
                    var panel = (CollapsiblePanel)this.Control;
                    if (!String.IsNullOrEmpty(panel.Name))
                    {
                        if (String.IsNullOrEmpty(panel.HeaderText))
                        {
                            panel.HeaderText = panel.Name;
                        }
                    }
                }

                collection.Add(new CollapsiblePanelActionList(this.Control));

                return collection;
            }
        }
    }
}